import request from '@/request/index.js'
const base = 'base' //http://101.42.107.47:30020文档

//获取所有的菜单数据
export const getAllMenuList = (data) => {
    return request({
        url: `/api/${base}/api/source/tree`,
        method: 'GET',
    })
}

//新增项目
export const addProject = (data) => {
    return request({
        url: `/api/zhpt/work/project/add`,
        method: 'post',
        data,
    })
}
//新增施工人员到项目
export const peopleAddUserApi = (data) => {
    return request({
        url: `/api/zhpt/work/project/detail/add`,
        method: 'post',
        data,
    })
}

//获取项目列表
export const getAllProjectsListAPI = (params) => {
    return request({
        url: `/api/zhpt/work/project/list`,
        method: 'GET',
        params,
    })
}

//删除项目
export const delProjects = (data) => {
    return request({
        url: `/api/zhpt/work/project/batch`,
        data,
        method: 'POST',
    })
}

//获取项目详情
export const getInfo = (params) => {
    return request({
        url: `/api/zhpt/work/project/info`,
        method: 'GET',
        params,
    })
}

//修改项目
export const editRole = (data) => {
    return request({
        url: `/api/zhpt/work/project/edit`,
        method: 'POST',
        data,
    })
}

//查询项目人员
export const getProjectsAPI = (params) => {
    return request({
        url: `/api/zhpt/work/project/detail/list`,
        method: 'GET',
        params,
    })
}

//日报列表
export const getAllLogsAPI = (params) => {
    return request({
        url: `/api/zhpt/work/project/build/log/list`,
        method: 'GET',
        params,
    })
}

//日报详情

export const getAllLogDetailAPI = (params) => {
    return request({
        url: `/api/zhpt/work/project/build/log/info`,
        method: 'GET',
        params,
    })
}


//批量删除
export const batchDelRole = (data) => {
    return request({
        url: `/api/${base}/api/role/batch/delete`,
        method: 'POST',
        data,
    })
}

//批量启用
export const batchStartRole = (data) => {
    return request({
        url: `/api/${base}/api/role/batch/start`,
        method: 'POST',
        data,
    })
}

//批量禁用
export const batchStopRole = (data) => {
    return request({
        url: `/api/${base}/api/role/batch/stop`,
        method: 'POST',
        data,
    })
}

//项目添加用户
export const roleAddUserApi = (data) => {
    return request({
        url: `/api/${base}/api/role/user`,
        method: 'PUT',
        data,
    })
}